Skip to content

media: Wire URL-player renderer factory plumbing - #11056

Closed
abhijeetk wants to merge 4 commits into
youtube:mainfrom
abhijeetk:url-player-3
Closed

media: Wire URL-player renderer factory plumbing#11056
abhijeetk wants to merge 4 commits into
youtube:mainfrom
abhijeetk:url-player-3

Conversation

@abhijeetk

@abhijeetk abhijeetk commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Add CreateUrlPlayerRenderer to mojom::InterfaceFactory, guarded by
use_starboard_url_player, and route it through the renderer process,
browser media proxy, and GPU media service.

Add UrlPlayerRendererClientFactory, which creates a URL-player
MojoRenderer via MojoRendererFactory::CreateUrlPlayerRenderer and wraps
it in UrlPlayerRendererClient.

Add URL-player factory coverage and update fake InterfaceFactory
implementations in tests.

Build: ninja -C out/tvos-arm64-simulator_qa cobalt nplb media_unittests

Bug: 512045535

Add use_starboard_url_player GN capability flag, derived from
use_starboard_media and tvOS platform detection. Expose it as
BUILDFLAG(USE_STARBOARD_URL_PLAYER) through build_config.h and
register matching Mojo enabled_features entry.

Add RendererType::kUrlPlayer = 13 to the C++ enum, Mojom enum,
traits mapping, and histogram. The new enum is gated behind
USE_STARBOARD_URL_PLAYER so non-tvOS builds are unaffected.

This establishes the capability boundary for all subsequent
URL-player CLs.

Bug: 512045535
Add mojom::Renderer::InitializeWithUrl(client, source_url) to deliver
the URL on the renderer Mojo pipe, keeping URL delivery and
initialization ordered on the same pipe.

Add UrlPlayerRenderer for tvOS URL-based playback via SbPlayerBridge
and UrlPlayerRendererWrapper as the Mojo service bridge. The wrapper's
InitializeWithUrl() sets the URL on the renderer internally then calls
Initialize().

MojoRendererService validates the renderer type and URL before
forwarding via static_cast, guarded by GetRendererType() == kUrlPlayer
and ReportBadMessage().

Bug: 512045535
Add UrlPlayerRendererClient to the tvOS URL-player build, which drives
URL-player playback over Mojo by calling InitializeWithUrl() directly
on the renderer pipe.

Add MediaResource::GetMediaUrl() behind USE_STARBOARD_URL_PLAYER so the
client can retrieve the media URL from the demuxer. The base
implementation returns an empty GURL; UrlPlayerDemuxer will override it
in a later CL.

Client unit tests are deferred to a later CL when all their
dependencies (InitializeWithStreamPointers, SetSourceUrl mojom) are
available.

Build: ninja -C out/tvos-arm64-device_qa cobalt media_unittests (pass)
Add CreateUrlPlayerRenderer to mojom::InterfaceFactory, guarded by
use_starboard_url_player, and route it through the renderer process,
browser media proxy, and GPU media service.

Add UrlPlayerRendererClientFactory, which creates a URL-player MojoRenderer
via MojoRendererFactory::CreateUrlPlayerRenderer and wraps it in
UrlPlayerRendererClient.

Add URL-player factory coverage and update fake InterfaceFactory
implementations in tests.

Build: ninja -C out/tvos-arm64-device_qa cobalt nplb media_unittests

Bug: 512045535
@abhijeetk

Copy link
Copy Markdown
Collaborator Author

Thanks for all review comments. We are moving ahead with approach in PR #10698 (UrlPlayer using StarboardRenderer).
Closing this PR.

@abhijeetk abhijeetk closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant